﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using NetWing.Common.Data.SqlServer;

namespace NetWing.BPM.Admin.mjrooms
{
    public partial class tuiroom : NetWing.BPM.Core.BasePage.BpmBasePage
    {
        public string keyid = "";
        DataRow dr = null;
        public bool guoqi = false;
        public DateTime exp_time = DateTime.Now;
        protected void Page_Load(object sender, EventArgs e)
        {
            keyid = Request["keyid"];
            if (!string.IsNullOrEmpty(keyid))
            {
                dr = SqlEasy.ExecuteDataRow("select * from MJOrder where keyid=" + keyid + "");
                DataRow rdr = SqlEasy.ExecuteDataRow("select * from MJRooms where keyid=" + dr["roomid"].ToString() + "");
                exp_time = DateTime.Parse(rdr["exp_time"].ToString());
                //下面加1说明过期那天必须退房否则要加钱
                //DateTime.Compare(t1, t2)比较两个日期大小，排前面的小，排在后面的大，比如：2011 - 2 - 1就小于2012 - 3 - 2
                //返回值小于零：  t1 小于 t2。 
                //返回值等于零 ： t1 等于 t2。 
                //返回值大于零：  t1 大于 t2。 
                int k = DateTime.Compare(exp_time.AddDays(1), DateTime.Now);
                if (DateTime.Compare(exp_time.AddDays(1), DateTime.Now) < 0)
                {
                    guoqi = true;
                }


            }

        }
    }
}